<template>
  <div class="page-container">
    <!--工具栏-->
    <div class="toolbar" style="float:left;padding-top:10px;padding-left:15px;">
      <el-form :inline="true" :model="filters" ref="filters" :size="size">
        <el-form-item prop="phone">
          <el-input v-model="filters.customerPhone" placeholder="评论人手机号"></el-input>
        </el-form-item>
        <el-form-item prop="content">
          <el-input v-model="filters.comment" placeholder="评论内容"></el-input>
        </el-form-item>
        <el-form-item prop="source">
          <el-select
            v-model="filters.commentSource"
            style="width:200px"
            placeholder="请选择评论来源"
            clearable
          >
            <el-option
              v-for="item in source"
              :key="item.key"
              :label="item.value"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="content_status">
          <el-select v-model="filters.status" style="width:200px" placeholder="请选择评论状态" clearable>
            <el-option
              v-for="item in content_status"
              :key="item.key"
              :label="item.value"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="comment_time_start">
          <el-date-picker
            v-model="filters.create_time_start"
            type="datetime"
            placeholder="评论时间开始"
            style="width:200px"
            value-format="yyyy-MM-dd HH:mm:ss"
          ></el-date-picker>
        </el-form-item>
        <el-form-item prop="comment_time_start">
          <el-date-picker
            v-model="filters.create_time_end"
            type="datetime"
            placeholder="评论时间结束"
            style="width:200px"
            value-format="yyyy-MM-dd HH:mm:ss"
          ></el-date-picker>
        </el-form-item>
        <!-- <el-form-item prop="max_content">
          <el-input v-model="filters.maxCommentNumber" placeholder="最大评论字数"></el-input>
        </el-form-item>
        <el-form-item prop="min_content">
          <el-input v-model="filters.minCommentNumber" placeholder="最小评论字数"></el-input>
        </el-form-item> -->
        <!-- <el-form-item placeholder="商品类目">
          <el-input v-model="filters.minCommentNumber" placeholder="商品类目"></el-input>

        </el-form-item> -->
        <el-form-item prop="productName">
          <el-input v-model="filters.productName" placeholder="商品名称"></el-input>
        </el-form-item>
        <el-form-item prop="product_number">
          <el-input v-model="filters.product_no" placeholder="商品编码"></el-input>
        </el-form-item>
        <el-form-item prop="max_score">
          <el-input v-model="filters.maxScore" placeholder="最大商品评分"></el-input>
        </el-form-item>
        <el-form-item prop="min_score">
          <el-input v-model="filters.minScore" placeholder="最小商品评分"></el-input>
        </el-form-item>
        <el-form-item prop="account">
          <el-input v-model="filters.reviewAccount" placeholder="审核人账号"></el-input>
        </el-form-item>
        <el-form-item prop="examine_time_start">
          <el-date-picker
            v-model="filters.create_time_start"
            type="datetime"
            placeholder="审核时间开始"
            style="width:200px"
            value-format="yyyy-MM-dd HH:mm:ss"
          ></el-date-picker>
        </el-form-item>
        <el-form-item prop="create_time_start">
          <el-date-picker
            v-model="filters.create_time_end"
            type="datetime"
            placeholder="审核时间结束"
            style="width:200px"
            value-format="yyyy-MM-dd HH:mm:ss"
          ></el-date-picker>
        </el-form-item>
        <el-form-item prop="order_number">
          <el-input v-model="filters.orderNo" placeholder="订单编号"></el-input>
        </el-form-item>
        <el-form-item prop="is_up">
          <el-select v-model="filters.topFlag" style="width:200px" placeholder="请选择是否置顶" clearable>
            <el-option v-for="item in is_up" :key="item.key" :label="item.value" :value="item.key"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="is_reply">
          <el-select
            v-model="filters.replyFlag"
            style="width:200px"
            placeholder="请选择是否回复"
            clearable
          >
            <el-option
              v-for="item in is_reply"
              :key="item.key"
              :label="item.value"
              :value="item.key"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="is_img">
          <el-select v-model="filters.is_img" style="width:200px" placeholder="请选择是否有图" clearable>
            <el-option v-for="item in is_img" :key="item.key" :label="item.value" :value="item.key"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="source_from">
          <el-select v-model="filters.sourceFrom" style="width:200px" placeholder="来源渠道" clearable>
            <el-option
              v-for="item in sourceFrom"
              :key="item.key"
              :label="item.value"
              :value="item.key"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-row style="text-align:center">
          <el-form-item>
            <kt-button
              icon="fa fa-search"
              :label="$t('action.search')"
              type="primary"
              @click="findPage(null)"
            />
          </el-form-item>
          <el-form-item>
            <kt-button icon="fa fa-refresh" :label="$t('action.reset')" type="primary" @click="resetForm('filters')" />
          </el-form-item>
          <el-form-item>
            <kt-button label="导出评论" type="primary" @click="handleAdd" />
          </el-form-item>
        </el-row>
      </el-form>
    </div>

    <div class="tab-container">
      <el-alert
        :closable="false"
        style="background-color: #ffffff;color: #ffffff;"
        title
        type="success"
      />
      <div style="text-align:left">
        <kt-button label="批量审核通过" type="primary" @click="batchCheckYes" />
        <kt-button label="批量审核不通过  " type="primary" @click="batchCheckNo" />
        <kt-button label="筛选条件下全部审核通过" type="primary" @click="allCheckYesByFilters" />
      </div>
      <el-tabs>
        <el-tab-pane label="全部评论">
          <el-table
            border
            fit
            ref="multipleTable"
            :data="tableData"
            tooltip-effect="dark"
            style="width: 100%"
            @selection-change="handleSelectionChange"
          >
            <el-table-column
              align="center"
              width="60"
              type="selection"

            ></el-table-column>

            <el-table-column
              v-loading="loading"
              align="center"
              label="查看"
              width="80"
              element-loading-text="请给我点时间！"
            >
              <template slot-scope="scope">
                <span>{{ scope.row.activityId }}</span>
              </template>
            </el-table-column>

            <el-table-column width="185px" align="center" label="评论时间" prop="createTime"></el-table-column>

            <el-table-column width="110px" align="center" label="评论人账号">
              <template slot-scope="scope">
                <span>{{ scope.row.memberAccount}}</span>
              </template>
            </el-table-column>

            <el-table-column width="110px" align="center" label="订单编号">
              <template slot-scope="scope">
                <span>{{ scope.row.orderNo }} </span>
              </template>
            </el-table-column>

            <el-table-column width="110px" align="center" label="商品名称">
              <template slot-scope="scope">
                <span>{{ scope.row.productName}}</span>
              </template>
            </el-table-column>

            <el-table-column class-name="status-col" align="center" label="商品评分" width="110">
              <template slot-scope="scope">
                <span>{{ scope.row.startNum }}</span>
              </template>
            </el-table-column>
            <el-table-column class-name="status-col" align="center" label="评论内容" width="300">
              <template slot-scope="scope">
                <span>{{ scope.row.status }}</span>
              </template>
            </el-table-column>
            <el-table-column class-name="status-col" align="center" label="评论图片" width="200">
              <template slot-scope="scope">
                <span>{{ scope.row.status }}</span>
              </template>
            </el-table-column>
            <el-table-column class-name="status-col" align="center" label="评论渠道" width="110">
              <template slot-scope="scope">
                <span>{{ scope.row.status }}</span>
              </template>
            </el-table-column>
            <el-table-column class-name="status-col" align="center" label="置顶状态" width="110">
              <template slot-scope="scope">
                <span>{{ scope.row.stickyStatus }}</span>
              </template>
            </el-table-column>
            <el-table-column class-name="status-col" align="center" label="审核状态" width="130">
              <template slot-scope="scope">
                <span>{{ scope.row.status }}</span>
              </template>
            </el-table-column>

            <el-table-column class-name="status-col" align="center" label="操作" width="290">
              <template slot-scope="scope">

                <span v-if="scope.row.type =='1'">
                  <el-button type="text" class="textButton" @click="handleDetail">查看</el-button>
                  <el-button type="text" class="textButton" @click="pass" :disabled="isPass">审核通过</el-button>
                  <el-button type="text" class="textButton" @click="noPass" :disabled="isPass2">审核不通过</el-button>
                  <el-button type="text" class="textButton" @click="noUp" v-if="upShow">取消置顶</el-button>
                   <el-button type="text" class="textButton" @click="isUp" v-if="upShows">置顶</el-button>
                  <el-button type="text" class="textButton" @click="reply">回复</el-button>
                </span>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="初次评论 " @click="getFirstComment">
          <el-table :data="tableData1" border fit highlight-current-row style="width: 100%">
            <el-table-column
              v-loading="loading"
              align="center"
              width="60"
              type="selection"
              element-loading-text="请给我点时间！"
            >
              <template slot-scope="scope">
                <span>{{ scope.row.activityId }}</span>
              </template>
            </el-table-column>
            <el-table-column
              v-loading="loading"
              align="center"
              label="查看"
              width="80"
              element-loading-text="请给我点时间！"
            >
              <template slot-scope="scope">
                <span>{{ scope.row.activityId }}</span>
              </template>
            </el-table-column>

            <el-table-column width="185px" align="center" label="评论时间">
              <template slot-scope="scope">
                <span>{{ scope.row.title}}</span>
              </template>
            </el-table-column>

            <el-table-column width="110px" align="center" label="评论人账号">
              <template slot-scope="scope">
                <span>{{ scope.row.memberAccount}}</span>
              </template>
            </el-table-column>

            <el-table-column width="110px" align="center" label="订单编号">
              <template slot-scope="scope">
                <span>{{ scope.row.orderNo }}</span>
              </template>
            </el-table-column>

            <el-table-column width="110px" align="center" label="商品名称">
              <template slot-scope="scope">
                <span>{{ scope.row.productName}}</span>
              </template>
            </el-table-column>

            <el-table-column class-name="status-col" align="center" label="商品评分" width="110">
              <template slot-scope="scope">
                <span>{{ scope.row.status }}</span>
              </template>
            </el-table-column>
            <el-table-column class-name="status-col" align="center" label="评论内容" width="300">
              <template slot-scope="scope">
                <span>{{ scope.row.status }}</span>
              </template>
            </el-table-column>
            <el-table-column class-name="status-col" align="center" label="评论图片" width="200">
              <template slot-scope="scope">
                <span>{{ scope.row.status }}</span>
              </template>
            </el-table-column>
            <el-table-column class-name="status-col" align="center" label="评论渠道" width="110">
              <template slot-scope="scope">
                <span>{{ scope.row.status }}</span>
              </template>
            </el-table-column>
            <el-table-column class-name="status-col" align="center" label="置顶状态" width="110">
              <template slot-scope="scope">
                <span>{{ scope.row.stickyStatus }}</span>
              </template>
            </el-table-column>
            <el-table-column class-name="status-col" align="center" label="审核状态" width="130">
              <template slot-scope="scope">
                <span>{{ scope.row.status }}</span>
              </template>
            </el-table-column>

            <el-table-column class-name="status-col" align="center" label="操作" width="290">
              <template slot-scope="scope">
                <span v-if="scope.row.type =='1'">
                  <el-button type="text" class="textButton" @click="handleDetail">查看</el-button>
                  <el-button type="text" class="textButton" @click="pass" :disabled="isPass">审核通过</el-button>
                  <el-button type="text" class="textButton" @click="noPass" :disabled="isPass2">审核不通过</el-button>
                  <el-button type="text" class="textButton" @click="noUp" v-if="upShow">取消置顶</el-button>
                   <el-button type="text" class="textButton" @click="isUp" v-if="upShows">置顶</el-button>
                  <el-button type="text" class="textButton" @click="reply">回复</el-button>
                </span>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="追加评论 " @click="getSecondComment">
          <el-table :data="tableData2" border fit highlight-current-row style="width: 100%">
            <el-table-column
              v-loading="loading"
              align="center"
              width="60"
              type="selection"
              element-loading-text="请给我点时间！"
            >
              <template slot-scope="scope">
                <span>{{ scope.row.activityId }}</span>
              </template>
            </el-table-column>
            <el-table-column
              v-loading="loading"
              align="center"
              label="查看"
              width="80"
              element-loading-text="请给我点时间！"
              prop
            >
              <template slot-scope="scope">
                <span>{{ scope.row.activityId }}</span>
              </template>
            </el-table-column>

            <el-table-column width="185px" align="center" label="评论时间" prop="createTime">
              <template slot-scope="scope">
                <span>{{ scope.row.title}}</span>
              </template>
            </el-table-column>

            <el-table-column width="185px" align="center" label="评论人账号">
              <template slot-scope="scope">
                <span>{{ scope.row.memberAccount}}</span>
              </template>
            </el-table-column>

            <el-table-column width="185px" align="center" label="订单编号">
              <template slot-scope="scope">
                <span>{{ scope.row.orderNo }}</span>
              </template>
            </el-table-column>

            <el-table-column width="110px" align="center" label="商品名称">
              <template slot-scope="scope">
                <span>{{ scope.row.productName}}</span>
              </template>
            </el-table-column>

            <el-table-column class-name="status-col" align="center" label="商品评分" width="110">
              <template slot-scope="scope">
                <span>{{ scope.row.status }}</span>
              </template>
            </el-table-column>
            <el-table-column class-name="status-col" align="center" label="评论内容" width="300">
              <template slot-scope="scope">
                <span>{{ scope.row.status }}</span>
              </template>
            </el-table-column>
            <el-table-column class-name="status-col" align="center" label="评论图片" width="200">
              <template slot-scope="scope">
                <span>{{ scope.row.status }}</span>
              </template>
            </el-table-column>
            <el-table-column class-name="status-col" align="center" label="评论渠道" width="110">
              <template slot-scope="scope">
                <span>{{ scope.row.status }}</span>
              </template>
            </el-table-column>
            <el-table-column class-name="status-col" align="center" label="置顶状态" width="110">
              <template slot-scope="scope">
                <span>{{ scope.row.stickyStatus }}</span>
              </template>
            </el-table-column>
            <el-table-column class-name="status-col" align="center" label="审核状态" width="110">
              <template slot-scope="scope">
                <span>{{ scope.row.status }}</span>
              </template>
            </el-table-column>

            <el-table-column class-name="status-col" align="center" label="操作" width="290">
              <template slot-scope="scope">
                <span v-if="scope.row.type =='1'">
                  <el-button type="text" class="textButton" @click="handleDetail">查看</el-button>
                  <el-button type="text" class="textButton" @click="pass" :disabled="isPass">审核通过</el-button>
                  <el-button type="text" class="textButton" @click="noPass" :disabled="isPass2">审核不通过</el-button>

                  <el-button type="text" class="textButton" @click="reply">回复</el-button>
                </span>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
      </el-tabs>
    </div>

    <!--详情查看-->
    <el-dialog title="详情查看" width="60%" :visible.sync="dialogVisible" :close-on-click-modal="false">
      <el-form
        :model="dataForm"
        :inline="true"
        label-width="80px"
        ref="dataForm"
        :size="size"
        label-position="right"
      >
        <el-form-item label="ID" prop="id" v-if="false">
          <el-input v-model="dataForm.id" :disabled="true" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="评论时间" prop="create_time">
          <el-input v-model="dataForm.create_time" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="商品编码" prop="pro_number">
          <el-input v-model="dataForm.product_no" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="评论人" prop="contene_name">
          <el-input v-model="dataForm.customer_account" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="商品类目" prop="productItemName">
          <el-input v-model="dataForm.product_item_name" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="订单编号" prop="order_no">
          <el-input v-model="dataForm.order_no" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="商品名称" prop="name">
          <el-input v-model="dataForm.product_name" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="置顶状态" prop="is_up">
          <el-input v-model="dataForm.top_flag" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="回复状态" prop="replyFlag">
          <el-input v-model="dataForm.reply_flag" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="审核状态" prop="status">
          <el-input v-model="dataForm.status" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="审核人" prop="shenhe_name">
          <el-input v-model="dataForm.create_account" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="审核时间" prop="shenhe_time">
          <el-input v-model="dataForm.create_time" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="来源" prop="source">
          <el-input v-model="dataForm.comment_source" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="商品评分" prop="score">
          <el-input v-model="dataForm.score" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="内容" prop="content">
          <el-input v-model="dataForm.comment" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="图片" prop="img">
          <el-input v-model="dataForm.img_url" auto-complete="off"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer" style="text-align:center">
        <el-button :size="size" @click.native="dialogVisible = false">
          {{
          $t("action.cancel")
          }}
        </el-button>
      </div>
    </el-dialog>
    <!--回复-->
    <el-dialog
      title="回复内容"
      width="60%"
      :visible.sync="dialogVisibleReply"
      :close-on-click-modal="false"
    >
      <el-table :data="tableReplyData" border fit style="width: 100%">
        <el-table-column prop="replyName" label="回复人"></el-table-column>
        <el-table-column prop="content" label="内容"></el-table-column>
        <el-table-column prop="reply_time" label="回复时间"></el-table-column>
      </el-table>
      <div style="padding-top: 25px;">
        <el-form
          :model="dataForm"
          :inline="true"
          label-width="80px"
          ref="dataForm"
          :size="size"
          label-position="right"
        >
          <el-form-item label="ID" prop="id" v-if="false">
            <el-input v-model="dataForm.id" :disabled="true" auto-complete="off"></el-input>
          </el-form-item>
          <el-form-item label="回复" prop="img">
            <input type="textarea" style="width: 300px;height:100px" placeholder="请输入内容" />
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer" style="text-align:center">
        <el-button :size="size" @click.native="dialogVisibleReply = false">
          {{
          $t("action.cancel")
          }}
        </el-button>
        <el-button :size="size" type="primary" @click="submitFormReply">{{ $t("action.submit") }}</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import KtButton from "@/views/Core/KtButton";
import { format } from "@/utils/datetime";
import TableColumnFilterDialog from "@/views/Core/TableColumnFilterDialog";
import { darkmagenta } from "color-name";

export default {
  name: "Tab",
  components: {
    KtButton,
    TableColumnFilterDialog
  },
  data() {
    return {
      isPass:true,
      isPass2:false,
      upShow:false,
      upShows:true,
      filters: {
        // channel: "",
        // merchantId: "",
        // pid: "",
        // type: "",
        // memberAccount: "",
        // orderNo: "",
        // productId: "",
        // productName: "",
        // productImg: "",
        // content: null,
        // startNum: "",
        // status: "",
        // stickyStatus: "",
        // createTime: "",
        // updateTime: ""
      },
      tableReplyData: [],
      pageRequest: { pageNum: 1, pageSize: 10 },
      dialogVisibleReply: false,
      dataForm: {},
      dialogVisible: false,
      tabMapOptions: [
        { label: "全部"},
        { label: "初次评论", key: "0" },
        { label: "追加评论", key: "1" }
      ],
      activeName: "0",
      tableData: [{}],
      tableData1: [{}],
      tableData2: [{}],
      listQuery: {
        page: 1,
        limit: 5,
        type: this.type,
        sort: "+id"
      },
      loading: false,

      activeName: "0",
      createdTimes: 0,
      size: "small",

      status: [
        { key: "0", value: "审核通过" },
        { key: "1", value: "审核拒绝" }
      ],
      content_status: [
        { key: "-1", value: "全部" },
        { key: "0", value: "系统审核通过" },
        { key: "1", value: "待人工审核" },
        { key: "2", value: "人工审核通过" },
        { key: "3", value: "人工审核不通过" },
        { key: "4", value: "可修改" }
      ],
      is_up: [
        { key: "0", value: "置顶" },
        { key: "1", value: "未置顶" }
      ],
      is_reply: [
        { key: "0", value: "有回复" },
        { key: "1", value: "未回复" }
      ],
      is_img: [
        { key: "0", value: "有图" },
        { key: "1", value: "无图" }
      ],
      sourceFrom: [
        { key: "0", value: "BBC" },
        { key: "1", value: "天猫" },
        { key: "1", value: "京东" }
      ],
      is_channel: [
        { key: "0", value: "BBC" },
        { key: "1", value: "天猫" },
        { key: "2", value: "京东" }
      ],
      source: [
        { key: "-1", value: "全部" },
        { key: "0", value: "安卓" },
        { key: "1", value: "IOS" },
        { key: "2", value: "PC" },
        { key: "3", value: "H5" }
      ],
      // filters: {
      //   phone: "",
      //   content: "",
      //   source: "",
      //   content_status: "",
      //   apply_time_start: "",
      //   apply_time_end: "",
      //   max_content: "",
      //   min_content: "",
      //   product_type: "",
      //   product_name: "",
      //   product_number: "",
      //   max_score: "",
      //   min_score: "",
      //   account: "",
      //   examine_time_start: "",
      //   examine_time_end: "",
      //   order_number: "",
      //   is_up: "",
      //   is_reply: "",
      //   is_img: "",
      //   is_channel: ""
      // },
      selections: []
    };
  },

  methods: {
    //查看评论
    handleDetail: function() {

        this.dialogVisible = true;


    },


    //初次评论
    getFirstComment:function(data){
      let this_ = this;
      if (this_.filters == undefined || this_.filters == null) {
        this_.filters = {};
      }
      this_.filters.start = this.pageRequest.pageNum;
      this_.filters.limit = this.pageRequest.pageSize;
      this_.filters.type = 0; //评论类型
      this_.utils.request.getProductCommentPage(this_.filters, function(res) {
        this_.tableData1 = res.data.rows;
      });
    },

     //追加评论
    getSecondComment:function(data){
      let this_ = this;
      if (this_.filters == undefined || this_.filters == null) {
        this_.filters = {};
      }
      this_.filters.start = this.pageRequest.pageNum;
      this_.filters.limit = this.pageRequest.pageSize;
      this_.filters.type = 1; //评论类型
      this_.utils.request.getProductCommentPage(this_.filters, function(res) {
        this_.tableData2 = res.data.rows;
      });
    },

    //页面数据初始化
    findPage: function(data) {
      let this_ = this;
      if (this_.filters == undefined || this_.filters == null) {
        this_.filters = {};
      }
      this_.filters.start = this.pageRequest.pageNum;
      this_.filters.limit = this.pageRequest.pageSize;

      this_.utils.request.getProductCommentPage(this_.filters, function(res) {
        this_.tableData = res.data.rows;
      });
    },
    submitFormReply: function() {
      this.$message({ message: "操作成功", type: "success" });
      this.dialogVisibleReply = false;
    },
    reply: function() {
      this.dialogVisibleReply = true;
    },
    // 导出评论
    handleAdd: function() {
      this.dialogVisible = true;
      this.operation = true;
      this.dataForm = {};
    },
    //批量审核通过
    batchCheckYes: function(data) {
      if (this.selections.length == 0) {
        this.$message({ message: "请选择要操作的数据", type: "error" });
        return;
      } else {
        this.$message({ message: "操作成功", type: "success" });
      }
    },
    //批量审核不通过
    batchCheckNo: function(data) {
      if (this.selections.length == 0) {
        this.$message({ message: "请选择要操作的数据", type: "error" });
        return;
      } else {
        this.$message({ message: "操作成功", type: "success" });
      }
    },
    //筛选条件下全部审核通过
    allCheckYesByFilters: function() {
      this.$message({ message: "操作成功", type: "success" });
    },
    isUp: function(row) {
      let this_=this
      this_.upShow=true
      this_.upShows=false
      this.$message({ message: "置顶成功", type: "success" });
    },
    noUp: function(row) {

        let this_=this
      this_.upShow=false
      this_.upShows=true
      this.$message({ message: "取消置顶成功", type: "success" });

    },
    pass: function() {
      let this_=this
      this_.isPass=true
       this_.isPass2=false
      this.$message({ message: "操作成功", type: "success" });
    },
    noPass: function() {
      let this_=this
      this_.isPass2=true
      this_.isPass=false
      this.$message({ message: "操作成功", type: "success" });
    },

    handleSelectionChange(val) {

      console.log("CNMB" + val);
      this.selections = val;
    },
    getList() {
      this.loading = true;
      this.$emit("create"); // for test
      // fetchList(this.listQuery).then(response => {
      var key = "status" + this.listQuery.type;
      this.list = this.tableList[key];
      this.loading = false;
      // })
    },
    // 时间格式化
    dateFormat: function(row, column, cellValue, index) {
      return format(row[column.property]);
    },

    resetForm(formName) {
      if (this.$refs[formName] != undefined) {
        this.$refs[formName].resetFields();
      }
    },
    createPage() {
      this.$router.push("/CreateHandsel");
    }
  },
  watch: {
    activeName(val) {
      this.$router.push(`${this.$route.path}?tab=${val}`);
    }
  },
  created() {
    // init the default selected tab
    const tab = this.$route.query.tab;
    if (tab) {
      this.activeName = tab;
    }
  },
  mounted() {
    this.findPage();
  }
};
</script>

<style scoped>
</style>
